/* 全局样式 */
:root {
    --bg-primary: #0f172a; /* 深蓝黑背景 */
    --bg-secondary: #1e1e1e; /* 次级背景 */
    --text-primary: #ffffff; /* 主文本颜色 */
    --text-secondary: #b0b0b0; /* 次级文本颜色 */
    --accent: #1e88e5; /* 强调色 - 科技蓝 */
    --accent-hover: #42a5f5; /* 悬停状态 */
    --border-radius: 8px; /* 圆角大小 */
    --transition: all 0.3s ease; /* 过渡效果 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #0f172a;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #0f172a;
    border-bottom: 1px solid #333;
}

.back-btn {
    /*background: #0f172a;*/
    /*color: white;*/
    /*border: none;*/
    /*padding: 8px 16px;*/
    /*border-radius: 4px;*/
    /*cursor: pointer;*/
    /*font-weight: 500;*/
    /*transition: background 0.3s;*/
    padding: 10px 20px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--accent);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    /*transition: var(--transition);*/
    text-align: center;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 平滑过渡 */
    transform: scale(1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.back-btn:hover {
    background: #0039CB;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #37474F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #2962FF;
    overflow: hidden;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.username {
    font-weight: 500;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2962FF;
    font-weight: 600;
}

/* 资源状态卡片 */
.resource-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.resource-card {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #2962FF;
}

.resource-label {
    font-size: 0.9rem;
    color: #9e9e9e;
    margin-bottom: 8px;
}

.resource-value {
    font-size: 1.8rem;
    font-weight: 600;
}

/* 功能模块区 */
.modules-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.module-card {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-5px);
    border-color: #2962FF;
    box-shadow: 0 8px 20px rgba(41, 98, 255, 0.2);
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #2962FF;
}

.module-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.module-status {
    font-size: 0.9rem;
    color: #9e9e9e;
}

.locked-module {
    opacity: 0.5;
    cursor: not-allowed;
}

.locked-module::after {
    content: "锁定中";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 30, 30, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #f44336;
}

/* 操作按钮区 */
.actions-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.action-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.end-turn-btn {
    background: #00C853;
    color: white;
}

.end-turn-btn:hover {
    background: #009624;
}

.upgrade-stage-btn {
    background: #2962FF;
    color: white;
}

.upgrade-stage-btn:hover {
    background: #0039CB;
}

.disabled-btn {
    background: #424242;
    color: #9e9e9e;
    cursor: not-allowed;
}

/* 底部版权 */
.footer {
    text-align: center;
    padding: 20px;
    background: #0f172a;
    border-top: 1px solid #333;
    color: #9e9e9e;
    font-size: 0.9rem;
}

/* 新增悬浮窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #1e1e1e;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #2962FF;
    box-shadow: 0 0 20px rgba(41, 98, 255, 0.3);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #252525;
    border-radius: 10px 10px 0 0;
}

.close-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #2962FF;
}

.module-details {
    padding: 20px;
}

.sub-module-card {
    background-color: #252525;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 3px solid #2962FF;
    display: flex;
    justify-content: space-between;
}

.sub-module-info {
    flex: 1;
}

.upgrade-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 180px;
}

.upgrade-btn {
    background: #2962FF;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.upgrade-btn:hover:not(:disabled) {
    background: #0039CB;
}

.upgrade-btn:disabled {
    background: #424242;
    cursor: not-allowed;
}

.promotion-modal {
    max-width: 600px;
}

.promotion-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.promotion-option {
    background-color: #252525;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #333;
    transition: border-color 0.3s;
}

.promotion-option:hover {
    border-color: #2962FF;
}

.promotion-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.promotion-btn:hover:not(:disabled) {
    background: #388E3C;
}

.promotion-btn:disabled {
    background: #424242;
    cursor: not-allowed;
}

/* 新增人力抽屉样式 */
.drawer {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background-color: #1e1e1e;
    border-right: 1px solid #333;
    z-index: 900;
    transition: left 0.3s ease;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.5);
}

.drawer-open {
    left: 0;
}

.drawer-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #252525;
}

.recruit-section {
    padding: 20px;
    border-bottom: 1px solid #333;
}

.recruit-btn {
    background: #2962FF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: background 0.3s;
}

.recruit-btn:hover:not(:disabled) {
    background: #0039CB;
}

.recruit-btn:disabled {
    background: #424242;
    cursor: not-allowed;
}

.insufficient-funds {
    color: #f44336;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

.human-list {
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 10px;
}

.human-card {
    background-color: #252525;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 3px solid #4CAF50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.human-info {
    flex: 1;
}

.human-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #9e9e9e;
}

.upgrade-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.upgrade-btn:hover:not(:disabled) {
    background: #388E3C;
}

.upgrade-btn:disabled {
    background: #424242;
    cursor: not-allowed;
}

/* 招募悬浮窗样式 */
.recruitment-modal {
    max-width: 700px;
}

.candidates-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

.candidate-card {
    background-color: #252525;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #333;
    transition: all 0.3s;
    cursor: pointer;
}

.candidate-card:hover {
    border-color: #2962FF;
}

.candidate-card.selected {
    border: 2px solid #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.candidate-info h4 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.recruitment-actions {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid #333;
}

.cancel-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.cancel-btn:hover {
    background: #d32f2f;
}

.confirm-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.confirm-btn:hover:not(:disabled) {
    background: #388E3C;
}

.confirm-btn:disabled {
    background: #424242;
    cursor: not-allowed;
}

/*新增候选者输入框样式*/
.candidate-name-input{
    width: 60%;
    padding: 15px;
    background: #1e88e5;
    color: white;
}

/* 回合结算悬浮窗 */
.turn-result-modal {
    max-width: 900px;
    padding: 0;
}

.turn-result-content {
    padding: 20px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #42a5f5;
    margin: 20px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

/* 周期卡片样式 */
.cycles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.cycle-card {
    background-color: #252525;
    border-radius: var(--border-radius);
    padding: 15px;
    border-left: 4px solid #42a5f5;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.cycle-card:hover {
    transform: translateY(-3px);
}

.cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.cycle-rank {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.cycle-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.cycle-stat {
    text-align: center;
    padding: 8px;
    background-color: rgba(66, 165, 245, 0.1);
    border-radius: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: #b0b0b0;
    margin-bottom: 5px;
}

.stat-value {
    font-weight: 600;
    font-size: 1.2rem;
}

/* 事件标签 */
.event-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 6px;
    transition: all 0.2s ease;
}

/* 回合总结样式 */
.turn-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    background-color: #252525;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.summary-label {
    font-size: 0.9rem;
    color: #b0b0b0;
    margin-bottom: 10px;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.summary-value.positive {
    color: #4caf50;
}

.summary-value.negative {
    color: #f44336;
}

.turn-result-footer {
    padding: 15px 20px;
    border-top: 1px solid #333;
    background-color: #252525;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: flex;
    justify-content: flex-end;
}

/* 游戏指南悬浮窗 */
.guide-overlay {
    background-color: rgba(0, 0, 0, 0.85);
}

.guide-modal {
    max-width: 1000px;
    max-height: 80vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.guide-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧导航 */
.guide-nav {
    width: 220px;
    background-color: #1a1a2e;
    padding: 20px 0;
    border-right: 1px solid #2d2d4d;
    overflow-y: auto;
}

.nav-header {
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #42a5f5;
    border-bottom: 1px solid #2d2d4d;
    margin-bottom: 15px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    padding: 12px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.nav-list li:hover {
    background-color: rgba(66, 165, 245, 0.1);
    border-left-color: rgba(66, 165, 245, 0.5);
}

.nav-list li.active {
    background-color: rgba(66, 165, 245, 0.15);
    border-left-color: #42a5f5;
    font-weight: 600;
    color: #42a5f5;
}

/* 右侧内容区域 */
.guide-content {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    max-height: calc(80vh - 130px);
}

.guide-section {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2d2d4d;
}

.guide-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 1.3rem;
    color: #42a5f5;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(66, 165, 245, 0.3);
}

.section-content {
    line-height: 1.7;
    font-size: 1rem;
    color: #e0e0e0;
}

/* 高亮样式 */
.highlight-blue {
    color: #42a5f5;
    font-weight: 600;
}

.highlight-green {
    color: #4caf50;
    font-weight: 600;
}

.highlight-red {
    color: #f44336;
    font-weight: 600;
}

.highlight-orange {
    color: #ff9800;
    font-weight: 600;
}

.highlight-purple {
    color: #9c27b0;
    font-weight: 600;
}

.highlight-gold {
    color: #ffd700;
    font-weight: 600;
}

/* 资源列表样式 */
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.resource-item {
    padding: 15px;
    background-color: rgba(30, 30, 46, 0.7);
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* 模块卡片样式 */
/*.module-card {*/
/*    display: flex;*/
/*    padding: 15px;*/
/*    background-color: rgba(30, 30, 46, 0.7);*/
/*    border-radius: 8px;*/
/*    margin: 20px 0;*/
/*    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);*/
/*}*/

/*.module-icon {*/
/*    font-size: 2.5rem;*/
/*    margin-right: 15px;*/
/*    color: #42a5f5;*/
/*}*/

.module-info {
    flex: 1;
}

.module-info h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #42a5f5;
}

/* 提示框样式 */
.tip-box {
    padding: 20px;
    background-color: rgba(30, 30, 46, 0.7);
    border-radius: 8px;
    border-left: 4px solid #4caf50;
    margin: 20px 0;
}

.tip-box p {
    margin: 10px 0;
}

/* 底部按钮 */
.guide-footer {
    padding: 15px 20px;
    border-top: 1px solid #2d2d4d;
    background-color: #1a1a2e;
    display: flex;
    justify-content: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .resource-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .modules-container {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .actions-container {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .sub-module-card {
        flex-direction: column;
    }

    .upgrade-section {
        align-items: flex-start;
        margin-top: 10px;
    }

    .drawer {
        width: 280px;
        left: -280px;
    }

    .candidates-container {
        grid-template-columns: 1fr;
    }

    .cycles-container {
        grid-template-columns: 1fr;
    }

    .turn-summary {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .guide-container {
        flex-direction: column;
    }

    .guide-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #2d2d4d;
        max-height: 200px;
    }

    .guide-content {
        max-height: calc(80vh - 330px);
    }
}

@media (max-width: 480px) {
    .turn-summary {
        grid-template-columns: 1fr;
    }

    .resource-list {
        grid-template-columns: 1fr;
    }

    .module-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .module-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* 新增动画关键帧 */
@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 头像旋转动画 */
.avatar {
    transition: transform 0.5s ease;
}

.avatar:hover {
    transform: rotate(15deg); /* 悬停旋转[4](@ref) */
}